<div class="tableform">
	<form action="index.php?<{$env.server.QUERY_STRING}>" method="post">
		<input type="hidden" name="order_setting[sid]" value="<{$order_setting.sid}>" size="30" />
		<table cellspacing="0" cellpadding="0" border="0">
            <tbody>
                <tr><th><b style="color:black">配置开票信息</b></th></tr>
                <tr>
                    <th>开票方名称：</th>
                    <td><input id="payee_name" type="text" name="order_setting[payee_name]" value="<{$order_setting.payee_name}>" size="30" /></td>
                </tr>
                <tr>
                    <th>开票方税号：</th>
                    <td><input id="tax_no" type="text" name="order_setting[tax_no]" value="<{$order_setting.tax_no}>" size="30" /></td>
                </tr>
                <tr>
                    <th>开票方地址：</th>
                    <td><input id="address" type="text" name="order_setting[address]" value="<{$order_setting.address}>" size="30" /></td>
                </tr>
                <tr>
                    <th>开票方电话：</th>
                    <td><input id="telephone" type="text" name="order_setting[telephone]" value="<{$order_setting.telephone}>" size="30" /></td>
                </tr>
                <tr>
                    <th>开票人：</th>
                    <td><input id="payee_operator"  type="text" name="order_setting[payee_operator]" value="<{$order_setting.payee_operator}>" size="30" /></td>
                </tr>
                <tr>
                    <th>税率：</th>
                    <td><input id="tax_rate" type="text" name="order_setting[tax_rate]" value="<{$order_setting.tax_rate}>" size="30" maxlength='2' />&nbsp;&nbsp;请填写不大于100的数字 例：17% 就填写 17；</td>
                </tr>
                <tr>
                    <th>开票方开户银行：</th>
                    <td><input id="bank" type="text" name="order_setting[bank]" value="<{$order_setting.bank}>" size="30" /></td>
                </tr>
                <tr>
                    <th>开票方银行账号：</th>
                    <td><input id="bank_no" type="text" name="order_setting[bank_no]" value="<{$order_setting.bank_no}>" size="30" /></td>
                </tr>
                <tr>
                    <th>发票内容：</th>
                    <td>
                       <select name="order_setting[content_id]" class="x-input-select inputstyle" type="select"> 
                            <{foreach from=$invoice_content item=val}>
                                <option value="<{$val.content_id}>" <{if $order_setting.content_id == $val.content_id}>selected<{/if}> ><{$val.content_name}></option> 
                            <{/foreach}>
                       </select> <em><font color="red">*&nbsp;&nbsp;</font></em>
                    </td>
                </tr>
                <tr>
                    <th>开票服务店铺：</th>
                    <td>
                        <select name="order_setting[billing_shop_node_id]">
					        <option value="">请选择...</option>
					        <{foreach from=$shopData item=v}>
					            <option value="<{$v.node_id}>" <{if $order_setting.billing_shop_node_id == $v.node_id}>selected<{/if}>><{$v.name}></option>
					        <{/foreach}>
			             </select> <em><font color="red">*&nbsp;开电子发票必选项 选取开票服务授权店铺</font></em>
                    </td>
                </tr>
                <tr>
                    <th>电子发票操作条件：</th>
                    <td>
                        <input type="radio" name="order_setting[einvoice_operating_conditions]" value="1" <{if $order_setting.einvoice_operating_conditions=='1' || !$order_setting.einvoice_operating_conditions}>checked<{/if}>>已发货
                        <input type="radio" name="order_setting[einvoice_operating_conditions]" value="2" <{if $order_setting.einvoice_operating_conditions=='2'}>checked<{/if}>>已付款
                        <em><font color="red">*&nbsp;选择订单相应的电子发票记录的操作条件（开蓝、冲红、上传天猫等）默认条件为已发货</font></em>
                    </td>
                </tr>
            </tbody>
		</table>
		<br />
		<table cellspacing="0" cellpadding="0" border="0">
            <tbody>
		        <tr><th><b style='color:black'>强制开票开关</b></th></tr>
		        <tr>
		            <th>下单发票设置：</th>
		            <td>
		                <input type="radio" onchange="check(1)" name="config" value="0" <{if $taxconf.config=='0' || $taxconf.config==''}>checked<{/if}>>关闭
		                <input type="radio" onchange="check(1)" name="config" value="1" <{if $taxconf.config=='1'}>checked<{/if}>>开启<font color='red'>(开启后,前端店铺同步到ERP没有开票订单将会变成开票,开票抬头将统一取下面设置)</font>
		            </td>
		        </tr>
		        <tr id='tax_setting'>
		            <th>发票抬头：</th>
		            <td><input type="text" name="title" value="<{$taxconf.title}>"></td>
		        </tr>
	        </tbody>
		</table>
		<br />
        <{button type='submit' label='保存'}>
	</form>
</div>
<script>
function check(status){
    if(status == 1){
        if($$('input[name=config]:checked').get('value') == 1){
            $('tax_setting').show();
            $('tax_setting').getFormElements().set('disabled',false);
        }else{
            $('tax_setting').hide();
            $('tax_setting').getFormElements().set('disabled',true);
        }
    }
}
check(1);

(function(){
	//配置发票时给个默认税率17
    var tax_rate = $('tax_rate').getValue();
    if(!tax_rate){
    	$('tax_rate').setAttribute("value","17");
    }
})();

</script>


